package com.hns.dev.linys.queue;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * Created by admin on 2019/9/12.
 */
public class DrainToTest {

    private static BlockingQueue<Integer> submitParamQueue = new LinkedBlockingQueue<>();
    private static BlockingQueue<Integer> middleParamQueue = new LinkedBlockingQueue<>();


    public static void main(String[] args) {

        submitParamQueue.offer(1);
        submitParamQueue.offer(2);
        submitParamQueue.offer(3);

        System.out.println(submitParamQueue.size());
        submitParamQueue.drainTo(middleParamQueue);
        System.out.println(middleParamQueue.size());
        System.out.println(submitParamQueue.size());

        submitParamQueue.offer(4);
        System.out.println(submitParamQueue.size());



    }




}
